{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\Administrator\\\\333.html'"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Map\n",
    "from pyecharts import options as opts\n",
    "\n",
    "\n",
    "value_1 = [3,21,1,2,1,3,1,1,2,3,2,2]\n",
    "attr_1 = [\"安徽\",\"浙江\",\"福建\",\"甘肃\",\"广西\",\"贵州\",\"河北\",\"河南\",\"湖北\",\"江西\",\"山西\",\"四川\"]\n",
    "\n",
    "def map_visualmap():\n",
    "    c = (\n",
    "        Map()\n",
    "        .add(\"商务数据181\", [list(z) for z in zip(attr_1, value_1)],\"china\")\n",
    "        \n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"Map-VisualMap（连续型）\"),\n",
    "            visualmap_opts=opts.VisualMapOpts(max_=3,is_piecewise=True)\n",
    "        )\n",
    "    )\n",
    "    return c\n",
    "a = map_visualmap()\n",
    "a.render(\"333.html\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\Administrator\\\\666.html'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pyecharts.options as opts\n",
    "from pyecharts.charts import WordCloud\n",
    "\n",
    "\"\"\"\n",
    "Gallery 使用 pyecharts 1.1.0\n",
    "参考地址: https://gallery.echartsjs.com/editor.html?c=xS1jMxuOVm\n",
    "\n",
    "目前无法实现的功能:\n",
    "\n",
    "1、暂无\n",
    "\"\"\"\n",
    "\n",
    "data = [\n",
    "    ('我们', 0.17330667075095504), ('这个', 0.09787480913658407), ('比如说', 0.05920621894866518), ('觉得', 0.05731043619632784), ('问题', 0.04371929241459369), ('一个', 0.03934028165498464), ('所以', 0.03899940874845574), ('这样', 0.03745129784114773), ('现在', 0.033674755660094945), ('咨询', 0.03356772113842502), ('什么', 0.03311910127650795), ('比较', 0.03131428666558224), ('实际上', 0.03023310271967118), ('然后', 0.02919833114267174), ('一样', 0.029055662982718517), ('时候', 0.028743343200938284), ('企业', 0.02799974571141092), ('可能', 0.027736035080101928), ('项目', 0.027270764546886345), ('就是', 0.02662712827565205), ('里面', 0.025776169078651216), ('员工', 0.025447446691034627), ('还是', 0.025034765178330077), ('公司', 0.02421415277956018), ('但是', 0.024183971406425583), ('没有', 0.023470046428106673), ('事情', 0.02328606311635856), ('因为', 0.022892950923834823), ('角度', 0.022668647392390395), ('一点', 0.022409317183374754), ('能力', 0.021362138428270033), ('那么', 0.02055636229719073), ('怎么样', 0.02029928657743647), ('东西', 0.019327735524124548), ('能够', 0.018194656381230107), ('来说', 0.018157124458282603), ('相当于', 0.017645016154990922), ('肯定', 0.017584747549595086), ('取费', 0.017526537109808712), ('30', 0.017526537109808712), ('解决', 0.01714836075697012), ('你们', 0.01651370714653728), ('自己', 0.01647888870756632), ('他们', 0.016419296840267383), ('不是', 0.01613923615898492), ('有些', 0.01596272434721167), ('大家', 0.015644301690674392), ('不能', 0.015599639118402679), ('来讲', 0.01542911647732477), ('业主', 0.015407593147824628), ('客户', 0.015343557676838872), ('真的', 0.015339007949625104), ('什么样', 0.015323966762517453), ('这种', 0.014968189285220607), ('整个', 0.014587867073584193), ('行业', 0.014578504749493855), ('服务', 0.01454509028802918), ('原来', 0.0144368198637685), ('不好', 0.01425314124464954), ('10', 0.014188149088892767), ('人均产值', 0.014029671451766266), ('个人', 0.013892559589024713), ('多少', 0.0136275589311945), ('人家', 0.01340686073016057), ('EPC', 0.01335355208366378), ('很多', 0.012888490749253004), ('通过', 0.01267463353744415), ('这么', 0.0124997960514926), ('刚才', 0.012456503440490785), ('也好', 0.012231283179977659), ('全过程', 0.012181692152192124), ('考虑', 0.011964977710773527), ('一些', 0.011831636933863448), ('未来', 0.011788812042750629), ('建筑', 0.011772038423135298), ('20', 0.011684358073205808), ('有个', 0.011684358073205808), ('就是说', 0.01158815532187657), ('或者', 0.01156030889910081), ('投资', 0.011406547750291818), ('当然', 0.01127046968329796), ('这里', 0.011246412958014521), ('价值', 0.011208771343282603), ('大部分', 0.011146600861586848), ('是不是', 0.011034125929037979), ('或者说', 0.010993714713784557), ('广场', 0.010927951700177326), ('一下', 0.010922705708170902), ('我要', 0.010849761067976822), ('怎么', 0.01079913553841804), ('前面', 0.010746662858052917), ('家里', 0.01073255885483524), ('业务', 0.01072142319204831), ('社区', 0.010687756054858978), ('创造', 0.0101846768414549), ('第二个', 0.010166693853830634), ('需求', 0.010107670363041051), ('包括', 0.010025422792084612), ('说实话', 0.009901827523550684), ('工作', 0.009682379104827563)\n",
    "]\n",
    "\n",
    "\n",
    "(\n",
    "    WordCloud()\n",
    "    .add(series_name=\"热点分析\", data_pair=data, word_size_range=[10,100])\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"热点分析\", title_textstyle_opts=opts.TextStyleOpts(font_size=23)\n",
    "        ),\n",
    "        tooltip_opts=opts.TooltipOpts(is_show=True),\n",
    "    )\n",
    "    .render(\"666.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\Administrator\\\\123.html'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Bar\n",
    "\n",
    "bar = Bar()\n",
    "bar.add_xaxis([\"衬衫\", \"羊毛衫\", \"雪纺衫\", \"裤子\", \"高跟鞋\", \"袜子\"])\n",
    "bar.add_yaxis(\"商家A\", [5, 20, 36, 10, 75, 90])\n",
    "# render 会生成本地 HTML 文件，默认会在当前目录生成 render.html 文件\n",
    "# 也可以传入路径参数，如 bar.render(\"mycharts.html\")\n",
    "bar.render(\"123.html\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\Administrator\\\\555.html'"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Map\n",
    "from pyecharts import options as opts\n",
    "\n",
    "\n",
    "value_1 = [155, 10, 66, 78, 44, 38, 88, 50, 20]\n",
    "attr_1 = [\"福建\",\"山东\",\"北京\",\"上海\",\"江西\",\"新疆\",\"内蒙古\",\"云南\",\"重庆\"]\n",
    "value_2 = [200, 100, 166, 78, 144, 38, 88, 150, 120]\n",
    "attr_2 = [\"辽宁\",\"广东\",\"广西\",\"青海\",\"甘肃\",\"新疆\",\"内蒙古\",\"云南\",\"重庆\"]\n",
    "def map_visualmap():\n",
    "    c = (\n",
    "        Map()\n",
    "        .add(\"商家A\", [list(z) for z in zip(attr_1, value_1)],\"china\")\n",
    "        .add(\"商家b\", [list(z) for z in zip(attr_2, value_2)],\"china\")\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"Map-VisualMap（连续型）\"),\n",
    "            visualmap_opts=opts.VisualMapOpts(max_=200,is_piecewise=True)\n",
    "        )\n",
    "    )\n",
    "    return c\n",
    "a = map_visualmap()\n",
    "a.render(\"555.html\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
